<template>
    <Toast v-if="show"/>
</template>

<script>
import { Toast } from 'vant';
export default {
    data(){
        return{
            show:false,
            roomid: ''
        }
    },
    components:{
        [Toast.name]:Toast
    },
    mounted(){
       const toast = Toast.loading({
        duration: 0,       // 持续展示 toast
        forbidClick: true, // 禁用背景点击
        loadingType: 'spinner',
        mask: false,
        message: '烟花观看结束'
        });
        let second = 5;
        const timer = setInterval(() => {
            if (second) {
                toast.message = `倒计时 ${second} 秒`;
                second--;
            } else {
                clearInterval(timer);
                Toast.clear();
                let roomid = this.$route.query.roomid
                wx.miniProgram.navigateBack({
                    url:`../chart/chart?roomid=${roomid}`
                })
            }
        }, 1000)
    },
    created() {
    }
}
</script>

<style>
</style>

